package com.lyf.swing;

import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

/**
 * @AUTHOR LYF
 * @DATE 2022/6/9
 * @VERSION 1.0
 * @DESC
 */
public class Login extends Frame {
    private String title;
    private Integer len,with;
    private Boolean visible;

    public Login(String title, Integer len, Integer with, Boolean visible) throws HeadlessException {
        this.title = title;
        this.len = len;
        this.with = with;
        this.visible = visible;
        Frame frame= new Frame();
        frame.setSize(with,len);
        frame.setVisible(true);
        Component c
                = new Button();
        frame.add(c);
    }

    public static void main(String[] args) {
       Frame frame = new Frame();
       frame.setSize(100,200);
       frame.setVisible(true);
       frame.add(new Button("hello"));
       Button button= new Button();
       button.addMouseListener(new MouseListener() {
           @Override
           public void mouseClicked(MouseEvent e) {
               System.out.println("hello,"+e.getClickCount());
           }

           @Override
           public void mousePressed(MouseEvent e) {
               System.out.println("hello,"+e.getClickCount());
           }

           @Override
           public void mouseReleased(MouseEvent e) {

           }

           @Override
           public void mouseEntered(MouseEvent e) {
               System.out.println("hello,"+e.getClickCount());
           }

           @Override
           public void mouseExited(MouseEvent e) {

           }
       });
    }

}
